<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
<ui:composition template="/_template.xhtml">
	<ui:define name="content">
	<div id="tree">
		<h:form>
			<p:tree value="#{treeBean.root}" var="doc" id="tree">
				<p:treeNode expandedIcon="ui-icon-folder-open"
					collapsedIcon="ui-icon-folder-collapsed">
					<h:outputText value="#{doc}" />
				</p:treeNode>

				<p:treeNode type="document" icon="ui-icon-document">
					<h:outputText value="#{doc}" />
				</p:treeNode>
			</p:tree>
		</h:form>
	</div>
	<div id="content">
		<h:form>
			<fieldset>
				<legend>Alterar Categoria</legend>
				<h:panelGrid columns="2">
					<h:outputLabel for="nome">Nome:</h:outputLabel>
					<p:inputText id="nome" value="#{categoriaBean.categoria.nome}" />
									
					<h:outputLabel for="descricao">Descricao:</h:outputLabel>
					<p:inputText id="descricao" value="#{categoriaBean.categoria.descricao}" />
									
					<p:commandButton name="Alterar" value="Alterar" action="#{categoriaBean.alterarCategoria}"/>
				</h:panelGrid>
				<p:messages id="messages" showDetail="true" autoUpdate="true" />
			</fieldset>
		</h:form>		
	</div>
	</ui:define>
</ui:composition>
</html>
